class ProjectusersController < ApplicationController
  # GET /projectusers
  # GET /projectusers.xml
  def index
    @projectusers = Projectuser.find(:all)

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @projectusers }
    end
  end

  # GET /projectusers/1
  # GET /projectusers/1.xml
  def show
    @projectuser = Projectuser.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @projectuser }
    end
  end

  # GET /projectusers/new
  # GET /projectusers/new.xml
  def new
    @projectuser = Projectuser.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @projectuser }
    end
  end

  # GET /projectusers/1/edit
  def edit
    @projectuser = Projectuser.find(params[:id])
  end

  # POST /projectusers
  # POST /projectusers.xml
  def create
    @projectuser = Projectuser.new(params[:projectuser])

    respond_to do |format|
      if @projectuser.save
        flash[:notice] = 'Projectuser was successfully created.'
        format.html { redirect_to(@projectuser) }
        format.xml  { render :xml => @projectuser, :status => :created, :location => @projectuser }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @projectuser.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /projectusers/1
  # PUT /projectusers/1.xml
  def update
    @projectuser = Projectuser.find(params[:id])

    respond_to do |format|
      if @projectuser.update_attributes(params[:projectuser])
        flash[:notice] = 'Projectuser was successfully updated.'
        format.html { redirect_to(@projectuser) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @projectuser.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /projectusers/1
  # DELETE /projectusers/1.xml
  def destroy
    @projectuser = Projectuser.find(params[:id])
    @projectuser.destroy

    respond_to do |format|
      format.html { redirect_to(projectusers_url) }
      format.xml  { head :ok }
    end
  end
end
